/*
 * File: SOPE_LookTab.c
 *
 * Code generated for Simulink model 'SOPE_LookTab'.
 *
 * Model version                  : 3.111
 * Simulink Coder version         : 9.4 (R2020b) 29-Jul-2020
 * C/C++ source code generated on : Fri Aug 27 08:57:32 2021
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: NXP->Cortex-M4
 * Code generation objective: MISRA C:2012 guidelines
 * Validation result: Not run
 */

#include "SOPE_LookTab.h"
#include "SOPE_LookTab_private.h"
#include "RTE.h"
#include "look2_iu16u8lu16n16tu1_GA5g36Xa.h"
#include "look2_iu8u16lu16n16tu1_h98F1U78.h"

/* Real-time model */
static RT_MODEL_SOPE_LookTab_T SOPE_LookTab_M_;
RT_MODEL_SOPE_LookTab_T *const SOPE_LookTab_M = &SOPE_LookTab_M_;

/* Exported data definition */

/* Definition for custom storage class: ExportToFile */
uint16_T Back_Cont_Curr = ((uint16_T)0U);/* '<S3>/Tab5' */
uint16_T Back_Pulse_Curr = ((uint16_T)0U);/* '<S3>/Tab12' */
uint16_T Dhg_Cont_Curr = ((uint16_T)0U);/* '<S3>/Tab7' */
uint16_T Dhg_Pulse_Curr = ((uint16_T)0U);/* '<S3>/Tab11' */
uint16_T sChgTabCurr = ((uint16_T)0U); /* '<S3>/Max1' */

/* Model step function */
void TASK_SOP(void)
{
    uint16_T Tab4;
    uint16_T u1;
    Tab4 = (uint16_T)(soce_pct_SOC / 100U);
    Dhg_Pulse_Curr = look2_iu8u16lu16n16tu1_h98F1U78(Rte_c_CellAvgTmp_GetVal(),
        Tab4, (&(Pccfg_DsgPluseCurr_TmpAxis[0])), rtCP_Tab11_bp02Data,
        (&(Pccfg_DsgPluseCurr_CurrTab[0])), rtCP_Tab11_maxIndex, 23U);
    Back_Pulse_Curr = look2_iu8u16lu16n16tu1_h98F1U78(Rte_c_CellAvgTmp_GetVal(),
        Tab4, (&(Pccfg_BackPluseCurr_TmpAxis[0])), rtCP_Tab12_bp02Data,
        (&(Pccfg_BackPluseCurr_CurrTab[0])), rtCP_Tab12_maxIndex, 22U);
    Back_Cont_Curr = look2_iu8u16lu16n16tu1_h98F1U78(Rte_c_CellAvgTmp_GetVal(),
        Tab4, (&(Pccfg_BackContCurr_TmpAxis[0])), rtCP_Tab5_bp02Data,
        (&(Pccfg_BackContCurr_CurrTab[0])), rtCP_Tab5_maxIndex, 22U);
    Dhg_Cont_Curr = look2_iu8u16lu16n16tu1_h98F1U78(Rte_c_CellAvgTmp_GetVal(),
        Tab4, (&(Pccfg_DsgContCurr_TmpAxis[0])), rtCP_Tab7_bp02Data,
        (&(Pccfg_DsgContCurr_CurrTab[0])), rtCP_Tab7_maxIndex, 25U);
    Tab4 = look2_iu16u8lu16n16tu1_GA5g36Xa(Rte_mv_CellMaxVol_GetVal(),
        Rte_c_CellMaxTmp_GetVal(), (&(Pccfg_SchgReqCurr_SOCAxis[0])),
        (&(Pccfg_SchgReqCurr_TmpAxis[0])), (&(Pccfg_SchgReqCurr_CurrTab[0])),
        rtCP_Tab4_maxIndex, 4U);
    u1 = look2_iu16u8lu16n16tu1_GA5g36Xa(Rte_mv_CellMaxVol_GetVal(),
        Rte_c_CellMinTmp_GetVal(), (&(Pccfg_SchgReqCurr_SOCAxis[0])),
        (&(Pccfg_SchgReqCurr_TmpAxis[0])), (&(Pccfg_SchgReqCurr_CurrTab[0])),
        rtCP_Tab2_maxIndex, 4U);
    if (Tab4 < u1)
    {
        sChgTabCurr = Tab4;
    }
    else
    {
        sChgTabCurr = u1;
    }
}

/* Model initialize function */
void SOPE_LookTab_initialize(void)
{
    /* (no initialization code required) */
}

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
